dnl Initialise automake system.
AC_INIT(usb-remap,0.0.1)
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR([configure.ac])
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

dnl Check for basic programs
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_CC
AC_CACHE_SAVE

dnl Checks for programs.
LK_AC_CHECK_REQ_PROG(RUBY,ruby)
AC_CACHE_SAVE

dnl Checks for libraries.
AC_PATH_XTRA
LK_AC_CHECK_RUBYLIB

dnl Detect libhid and whether its old or new.
LK_AC_CHECK_REQ_LIBH(hid,main,,http://libhid.alioth.debian.org)
AC_CHECK_DECL(HID_RET_TIMEOUT,[AC_DEFINE(LIBHID_HAS_TIMEOUT,[],[libhid has timeout])],[],[#include <hid.h>])

dnl Check for libusb 0.1
LK_AC_CHECK_REQ_LIBH(usb,main,,http://www.libusb.org/)

LK_AC_CHECK_REQ_LIBH(Xtst,main,$X_LIBS -lX11,your distribution)
LK_AC_CHECK_REQ_LIBH(X11,main,,your distribution)
AC_CACHE_SAVE

dnl Checks for header files.

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.

AC_CONFIG_FILES([ \
  Makefile \
])
AC_OUTPUT
